RiCal::OccurrenceEnumerator#occurrences ignores an original event
Reported by Takayuki Yamaguchi | August 8th, 2010 @ 06:19 AM
In the following code, the recurrence of the third event
"Event3" ignores the original event
starting at "2009/2/2 14:00:00".
When I set RRULE property (Event1 and Event2), this does not
occur.
When I set RDATE property without RRULE property,
the method RiCal::OccurrenceEnumerator#occurrences ignores the
original event.
require 'ri_cal'
calendar = RiCal.Calendar do |cal|
cal.event do |event|
event.summary = "Event1"
event.dtstart = DateTime.parse("2009/2/2 14:00:00")
event.dtend = DateTime.parse("2009/2/2 15:00:00")
event.add_rrule('FREQ=WEEKLY;BYDAY=TH;UNTIL=20090301')
end
cal.event do |event|
event.summary = "Event2"
event.dtstart = DateTime.parse("2009/2/2 14:00:00")
event.dtend = DateTime.parse("2009/2/2 15:00:00")
event.add_rrule('FREQ=WEEKLY;BYDAY=TH;UNTIL=20090301')
event.add_rdate(DateTime.parse("2009/2/4 16:00:00"), DateTime.parse("2009/2/5 16:00:00"))
end
cal.event do |event|
event.summary = "Event3"
event.dtstart = DateTime.parse("2009/2/2 14:00:00")
event.dtend = DateTime.parse("2009/2/2 15:00:00")
event.add_rdate(DateTime.parse("2009/2/4 16:00:00"), DateTime.parse("2009/2/5 16:00:00"))
end
end
calendar.events.each do |ev|
ev.occurrences.each do |oc|
puts "#{oc.summary}\t#{oc.start_time} - #{oc.finish_time}"
end
puts ""
end
No comments found
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป
A new icalendar data (RFC 2445) gem for Ruby which supports time zones and enumeration of occurrences